using System;
using CommunityToolkit.Mvvm.ComponentModel;
using SimpleToDoList.Models;

namespace SimpleToDoList.ViewModels;

public partial class ToDoItemViewModel : ViewModelBase {
    [ObservableProperty]
    private bool _isChecked;
    
    [ObservableProperty]
    private string? _content;

    public ToDoItemViewModel(ToDoItem toDoItem) {
        IsChecked = toDoItem.IsChecked;
        Content = toDoItem.Content;
    }

    public ToDoItem GetToDoItem() {
        return new ToDoItem() {
            IsChecked = this.IsChecked,
            Content = this.Content
        };
    }
}